﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI;
using System.Web;

namespace Common.BasePages
{
    public  class BasePage:Page
    {
        private object _userInfo = null;

        public object UserInfo
        {
            get
            {
                if (Session["UserInfo"] == null && HttpContext.Current.Cache["UserInfo"] == null)
                {
                    //Response.Redirect("../../Portal/Login.aspx?returnUrl=" + Request.Url.AbsolutePath);
                    //Response.Redirect("../../Portal/Login.aspx");
                    //Page.RegisterClientScriptBlock("login", "<script>window.location.href='../../Portal/Login.aspx'</script>");
                }
                else if (Session["UserInfo"] != null)
                {
                    _userInfo = Session["UserInfo"];
                }
                return _userInfo;
            }
            set
            {
                Session["UserInfo"] = value;
            }
        }
    }
}
